package com.lyrcsoft.webflux_02;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import reactor.core.publisher.Mono;

@SpringBootApplication
@RestController
@RequestMapping("/annt")
public class Webflux02Application {

    public static void main(String[] args) {
        SpringApplication.run(Webflux02Application.class, args);
    }

    /**
     * 返回的数据类型与SpringMvc不一致，返回的值由Spring容器去消费，然后返回
     *
     * @return
     */
    @GetMapping("/get")
    public Mono<String> hello() {
        return Mono.just("hello world");
    }
}
